package client.comm.baoding.dialog

import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import androidx.appcompat.app.AppCompatActivity
import client.comm.commlib.toast.toast
import client.comm.baoding.R
import client.comm.baoding.api.bean.GoodsOrder
import client.comm.baoding.databinding.DialogLookwlLayoutBinding
import client.tzstore.oo.dialog.CenterDialog

open class LookWlDialog(context: Context) : CenterDialog<DialogLookwlLayoutBinding>(context) {

    var title: String = ""

    var bean: GoodsOrder.Order? = null

    override fun getV(): Int {
        return R.layout.dialog_lookwl_layout
    }

    override fun postBinding() {
        binding.event = this
        bean?.let {
            binding.dh = it.logistics_num
            binding.gs = it.logistics_name
        }
    }

    fun fz(str: String) {
        val cmb = context.getSystemService(AppCompatActivity.CLIPBOARD_SERVICE) as ClipboardManager
        cmb.setPrimaryClip(ClipData.newPlainText(null, str))
        toast("已复制")
    }
}